import 'package:flame/components.dart';
import 'package:flame/text.dart' show TextStyle;
import 'package:flutter/material.dart' show Colors, FontWeight;

class TextCostSunlight extends TextComponent {
  static final textStyle = TextStyle(
    fontSize: 12,
    color: Colors.black,
    fontWeight: FontWeight.w300,
  );

  TextCostSunlight(String text) : super(text: text);

  @override
  Future<void> onLoad() async {
    textRenderer = TextPaint(style: textStyle);
    if (text.length == 2) {
      position = Vector2(22, 66);
    } else {
      position = Vector2(16, 66);
    }
    return super.onLoad();
  }
}
